/**
 * 
 */
package net.cloudcodex.client.campaign.view;

import net.cloudcodex.client.campaign.view.CampaignsView.Message;
import net.cloudcodex.client.campaign.view.panel.CampaignConfigPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.inject.Inject;

/**
 * @author Daniel
 *
 */
public class CampaignCreationViewImpl extends DecoratedPopupPanel implements
		CampaignCreationView {
	
	private CampaignConfigPanel campaignConfigPanel = new CampaignConfigPanel();
	private Message message ;

	/**
	 * 
	 */
	@Inject
	public CampaignCreationViewImpl(Message message) {
		super(false, true);
		this.setGlassEnabled(true);
		this.message = message ;
	}
	
	@Override
	public void initView(){
		campaignConfigPanel.setMessage(message);
		campaignConfigPanel.initComponent();
		campaignConfigPanel.removeStartedDateLbl();
		campaignConfigPanel.setActionMessage(message.getCreateButton());
		campaignConfigPanel.setActionButtonEnable(true);
		campaignConfigPanel.addCancelButton();
		this.add(campaignConfigPanel);
	}
	
	@Override
	public HasClickHandlers getCreateButton(){
		return campaignConfigPanel.getActionButton();
	}
	
	@Override
	public void showPopup() {
		this.center();
	}

	@Override
	public void hidePopup() {
		this.hide();
	}

	@Override
	public String getCampaignName() {
		return campaignConfigPanel.getCampaignName();
	}

	@Override
	public String getCampaignGame() {
		return campaignConfigPanel.getCampaignGame();
	}

	@Override
	public String getCampaignIcon() {
		return campaignConfigPanel.getCampaignIcon();
	}

	@Override
	public String getCampaignDescription() {
		return campaignConfigPanel.getCampaignDescription();
	}

	@Override
	public HasClickHandlers getCancelButton() {
		return campaignConfigPanel.getCancelButton();
	}

	@Override
	public void clearView() {
		campaignConfigPanel.clearView();
	}
}
